﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BeginPanel : MonoBehaviour
{
    
    public Rect titlePos;
    public GUIContent titleContent;
    public GUIStyle titleSytel;

    public Rect btn1Pos;
    public Rect btn2Pos;
    public Rect btn3Pos;
    public GUIStyle btnStyle;

    public static BeginPanel instance;
    private void Awake()
    {
        instance = this;
    }
    public static void Show()
    {
        if (instance)
        {
            instance.gameObject.SetActive(true);
        }
    }
    public static void Hide()
    {
        if (instance)
        {
            instance.gameObject.SetActive(false);
        }
    }

    private void OnGUI()
    {
        GUI.Label(titlePos, titleContent, titleSytel);
        if(GUI.Button(btn1Pos, "开始游戏", btnStyle))
        {
            LoginPanel.Show();
        }
        if(GUI.Button(btn2Pos, "设置游戏", btnStyle))
        {
            SettingPanel.Show();
        }
        if(GUI.Button(btn3Pos, "退出游戏", btnStyle))
        {
            ExitPanel.Show();
        }
    }
}
